<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:wh="http://java.sun.com/jsf/composite/wh"
	xmlns:p="http://primefaces.org/ui"
	xmlns:oc="http://java.sun.com/jsf/composite/owncomponents">
<h:body>
	<ui:composition template="template/companyTemplate.xhtml">
		<ui:define name="companyContent">

			<h1>Research and Development Investments / Service Investments</h1>
			<h:form id="companyRD" styleClass="horizontal_full">
				<p>This site represents the investments for the R&amp;D. R&amp;D
					investments could be investments in new studies or improvements of company services.
					R&amp;D investments also help you to improve your image.</p>
				<h:panelGrid columns="2">
					<h:panelGrid columns="1">
						<h:panelGrid columns="3">
							<h:outputLabel for="rdThis" value="R&amp;D-investment:" />
							<p:inputText id="rdThis" tabindex="1"
								value="#{companyMBean.rdInvestment}" 
								validatorMessage="R&amp;D-investment has to be a number between 0 and #{companyMBean.getMaxRD()}">
					        	<f:validateLongRange minimum="0" maximum="#{companyMBean.getMaxRD()}" />
					        </p:inputText>
					        <oc:fieldhelp helptext="Setting the R&amp;D investments for this round." show="true"/>
					        
							<h:outputText value=" " />
							<p:slider for="rdThis" step="10" minValue="0" maxValue="#{companyMBean.getMaxRD()}" style="min-width: 100px" />
							<oc:fieldhelp helptext="Slider helps you to set the investment between min and max-value." show="true"/>
							
							<h:outputLabel for="rdLast"
								value="R&amp;D-investment (last round):" />
							<p:inputText id="rdLast" disabled="true"
								value="#{companyMBean.prevRdInvestment}" />
							<oc:fieldhelp helptext="You have set this investment in the last round." show="true"/>
								
						</h:panelGrid>

						<p:commandButton value="Save R&amp;D Decisions"
							actionListener="#{companyMBean.saveRDDecision}"
							icon="ui-icon-disk" />

					</h:panelGrid>
					<p:chart type="line" model="#{companyMBean.rdInvestmentsChart}"
						styleClass="companyDecisionChart" />
				</h:panelGrid>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>